package com.example.neusoft.cook.interf;

import com.example.neusoft.cook.bean.FavorCook;
import com.example.neusoft.cook.bean.FavorShop;
import com.example.neusoft.cook.bean.Favoruse;
import com.example.neusoft.cook.bean.SampleCook;
import com.example.neusoft.cook.bean.SampleDeail;
import com.example.neusoft.cook.bean.SampleFavor;
import com.example.neusoft.cook.bean.SampleLogin;
import com.example.neusoft.cook.bean.SampleRegister;
import com.example.neusoft.cook.bean.SampleSearch;
import com.example.neusoft.cook.bean.SampleShop;
import com.example.neusoft.cook.bean.SampleUser;
import com.example.neusoft.cook.bean.SampleUserInfo;

import java.util.List;

import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by neusoft on 2017/4/10.
 */


public interface RetrofitService {
    //登录
     @GET("userLogin.do")
     Call<SampleLogin> userLogin(@Query("username") String username,
                                 @Query("userpass") String userpass);

    //注册
    @GET("userRegister.do")
    Call<SampleRegister> userRegister(@Query("username") String username,
                                      @Query("userpass") String userpass,
                                      @Query("mobilenum") String mobilenum,
                                      @Query("address") String address,
                                      @Query("comment") String comment);

    //获取所有店铺信息接口
    @GET("getAllShops.do")
    Call<List<SampleShop>> getAllShops();

    //获取当前店铺的所有菜单信息接口
    @GET("getFoodByShop.do")
    Call<List<SampleCook>> getFoodByShop(@Query("shop_id") String shopId);

    //获取菜谱详情接口
    @POST("getFoodById.do")
    Call<SampleDeail> getFoodById(@Query("food_id") String foodId);

    //获取当前用户的所有收藏信息接口
    @POST("getAllUserCollection.do")
    Call<List<SampleFavor>> getAllUserCollection(@Query("user_id") String userId,
                                                 @Query("flag") String flag);
    //收藏/取消收藏店铺接口
    @POST("userCollectShop.do")
    Call<FavorShop> userCollectShop(@Query("user_id") String userId,
                                    @Query("shop_id") String shopId);
    //收藏/取消收藏菜品接口
    @POST("userCollectFood.do")
    Call<FavorCook> userCollectFood(@Query("user_id") String userId,
                                    @Query("food_id") String foodId);
    //判断是否收藏接口
    @POST("isCollected.do")
    Call<Favoruse> isCollected(@Query("user_id") String userId,
                               @Query("shop_food_id") String shop_food_id,
                               @Query("flag") String flag);

    //搜索菜谱/口味接口
    @POST("getFoodBySearch.do")
    Call<List<SampleCook>> getFoodBySearch(@Query("search") String foodName);

    //修改用户信息
    @GET("updateUserById.do")
    Call<SampleUser> updateUserById(@Query("user_id") String userId,
                                    @Query("username") String username,
                                    @Query("userpass") String userpass,
                                    @Query("mobilenum") String mobilenum,
                                    @Query("address") String address);

    @GET("getUserById.do")
    Call<SampleUserInfo> getUserById(@Query("user_id") String user_id);


}
